# coding: utf-8

import json
import io
# 将python2的编码格式改为utf-8
import sys
reload(sys)
sys.setdefaultencoding('utf-8')


response_dict = {
    "accessToken": "2024021410000008eb15aa4c894fbd807dc25ddca9cba1-0019-1705284000",
    "busType": "BBSS",
    "cutOffDay": "20240131",
    "domain": "COP",
    "envFlag": "0",
    "routeType": "00",
    "routeValue": "230",
    "sessionID": "9741da1fd5a44abbbe65f7e7413cc8f0",
    "sign": "F052B3D2C0DFEB1B561C42E0E3C235FB",
    "signMethod": "md5",
    "timeStamp": "20240131182119",
    "transIDO": "9741da1fd5a44abbbe65f7e7413cc8f0",
    "userPartyID": "BBSS9980",
    "version": "1.0.0",
    "ServiceType": "POOrderService"
}

with io.open('json_data.json', 'rt', encoding='utf-8') as f:
    f_data = f.read()


json_data = json.loads(f_data)
content_json = json.loads(json_data['content'])
orderInfo_json = content_json['orderInfo']



orderInfo_json['finishTime'] = '20240131144800'
orderInfo_json['notes'] = ''
orderInfo_json['busNeedDegree'] = '4'
orderInfo_json['poOrderRatePlans'] = []
orderInfo_json['productOfferingID'] = '32300207578'
orderInfo_json['timeStamp'] = '20240131144800'
orderInfo_json['poAudit'] = [
    {
        "auditTime": "20240131114812",
        "auditor": "订单创建",
        "auditDesc": "订单创建"
    },
    {
        "auditTime": "20240131144759",
        "auditor": "订单同步",
        "auditDesc": "订单同步成功"
    },
    {
        "auditTime": "20240131144759",
        "auditor": "成功归档",
        "auditDesc": "成功归档"
    }
]
orderInfo_json['poOrderCharge'] = []
# orderInfo_json['poOrderNumber'] = '230A240131023437'
# orderInfo_json['productOrderNumber'] = '230A240131023437001'


productOrders_lis = orderInfo_json['productOrders']

for i in productOrders_lis:
    productID = 62300507072
    i['productOrder']['productID'] = str(productID)
    productID = str(productID+1)
    i = i
orderInfo_json['productOrders'] = productOrders_lis



content_json['orderInfo'] = orderInfo_json



content_json = json.dumps(content_json, ensure_ascii=False)
response_dict['content'] = content_json


response_dict = json.dumps(response_dict, ensure_ascii=False)

print(response_dict)





